package edu.mercer.sse554.bkp;

/**
 * Checked Exception for Backup Application.<p>
 * 
 * Visitor Pattern: accepts multiple visitor types for logging, conversion of
 * 	this checked exception.<p>
 * 
 * @see BackupUncheckedException
 * 
 * @see VisitableLogging
 * 
 * @see BackupErrorLoggingVisitor
 * 
 * @see VisitableConversion
 *  
 * @see BackupErrorConversionVisitor
*/

public class BackupException extends Exception 

	implements VisitableLogging<Boolean, 
								BackupErrorLoggingVisitor>,
	
			   VisitableConversion<BackupUncheckedException, 
			   					   BackupErrorConversionVisitor>

{
	private static final long serialVersionUID = 1032456534492661L;

	
	/**
	 * Create checked exception: BackupException.<p>
	 */
	
	BackupException()
	{
		super();
		
	}//constructor


	/**
	 * Create checked exception: BackupException.<p> 
	 * 
	 * @param messageIn - String message to pass along to parent Exception 
	 * 	constructor
	 */
	
	BackupException(final String messageIn)
	{
		super(messageIn);
		
	}//constructor
	

	/**
	 * Create checked exception: BackupException.<p> 
	 * 
	 * @param exceptionIn - Exception
	 */

	BackupException(final Exception exceptionIn)
	{
		super(exceptionIn);
		
	}//constructor
	

	/**
	 * Create checked exception: BackupException.<p> 
	 * 
	 * @param throwableIn - Throwable
	 */
	
	BackupException(final Throwable throwableIn)
	{
		super(throwableIn);
		
	}//constructor


	/**
	 * Create checked exception: BackupException.<p> 
	 * 
	 * @param errorIn - Error
	 */
	
	BackupException(final Error errorIn)
	{
		super(errorIn);
		
	}//constructor
	
	
	/**
	 * Create checked exception: BackupException.<p> 
	 * 
	 * @param errDescription - String message to pass along to Exception 
	 * 	constructor for wrapping original Throwable argument
	 * 
	 * @param errorIn - Throwable
	 */
	
	BackupException(final String errDescription, 
					final Throwable errorIn)
	{
		super(errDescription, errorIn);
		
	}//constructor

	
	@Fulfills("VisitableLogging")
	@Override
	public Boolean accept( BackupErrorLoggingVisitor visitor ) 
	{
		return visitor.visit( this );
		
	}//method


	@Fulfills("VisitableConversion")
	@Override
	public BackupUncheckedException accept( 
			final BackupErrorConversionVisitor visitor ) 
	{
		return visitor.visit( this );

	}//method

	
}//class
